let api = 'http://150.158.175.238'
function myAjax({ url = '', method = 'get', data = {}, headers = {} }) {
    let token = localStorage.getItem('token')
    // console.log(token);
    return new Promise((resolve) => {
        $.ajax({
            url: api+url,
            method,
            data,
            headers:{ "authorization": token },
            success(result) {
                resolve({ result }) //如果正确则有result，无err
            },
            error(err) {
                resolve({ err }) //如果是失败的那么无result，有err
            }
        })
    })
}